{% macro page(data,url) -%}
    {% if data %}
        <ul class="pagination pagination-sm pull-right">
            {% if data.has_prev %}
                <li>
                    <a href="{{ url_for(url,page=data.prev_num) }}" aria-label="Previous">
                        <span aria-hidden="true">上一页</span>
                    </a>
                </li>
            {% else %}
                <li class="disabled">
                    <a href="{{ url_for(url,page=data.prev_num) }}" aria-label="Previous">
                        <span aria-hidden="true">上一页</span>
                    </a>
                </li>
            {% endif %}
            {% for v in data.iter_pages(left_edge=2) %}
                {% if v %}
                    {% if v == data.page %}
                        <li class="active"><a href="{{ url_for(url,page=v) }}">{{ v }}</a></li>
                    {% else %}
                        <li><a href="{{ url_for(url,page=v) }}">{{ v }}</a></li>
                    {% endif %}
                {% else %}
                    <li class="disabled"><a href="#">&hellip;</a></li>
                {% endif %}
            {% endfor %}
            {% if data.has_next %}
                <li>
                    <a href="{{ url_for(url,page=data.next_num) }}" aria-label="Previous">
                        <span aria-hidden="true">下一页</span>
                    </a>
                </li>
            {% else %}
                <li class="disabled">
                    <a href="{{ url_for(url,page=data.next_num) }}" aria-label="Previous">
                        <span aria-hidden="true">下一页</span>
                    </a>
                </li>
            {% endif %}
        </ul>
    {% endif %}
{%- endmacro %}